package com.ruijiang.controller.vm_service;

import com.ruijiang.controller.ApiPrefix;
import com.ruijiang.service.VmService.BusinessTypeService;
import com.ruijiang.vo.businessType.BusinessBaseVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(ApiPrefix.VM_SERVICE+"/businessType")
@Slf4j
public class BusinessTypeController {

    @Autowired
    private BusinessTypeService businessTypeService;

    /**
     * 获取商圈列表
     * @return
     */
    @GetMapping
    public List<BusinessBaseVO> getBusinessTypeList(){
        log.info("获取商圈列表");
        List<BusinessBaseVO> list = businessTypeService.getBusinessTypeList();
        return  list;
    }

    @GetMapping("/name/{id}")
    public String getBusinessTypeName(@PathVariable String id){
        log.info("获取商圈名");
        return businessTypeService.getBusinessTypeName(id);

    }



}
